package com.zhuangjie.rider.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zhuangjie.base.dto.page.PageDTO;
import com.zhuangjie.base.vo.PageVO;
import com.zhuangjie.mvc.helper.GeoHelper.GeoCoordinates;
import com.zhuangjie.order.pojo.RiderDeliveryFeeForRiderOrderAccounting;
import com.zhuangjie.rider.dto.CreateDeliveryOrderDTO;
import com.zhuangjie.rider.dto.NearbyDeliveryOrderQueryDTO;
import com.zhuangjie.rider.entity.DeliveryOrder;
import com.zhuangjie.rider.vo.*;
import com.zhuangjie.rider.vo.PathPlanningVO.ShopForMap;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author zhuangjie
 * @since 2023-12-26
 */
public interface DeliveryOrderService extends IService<DeliveryOrder> {

    void tryCreateDeliveryOrder(CreateDeliveryOrderDTO createDeliveryOrderDTO) throws Exception;

    PageVO<NearbyDeliveryOrder> findNearbyDeliveryOrders(NearbyDeliveryOrderQueryDTO nearbyDeliveryOrderQueryDTO);

    Map<Long, List<DeliveryOrder>> findRidersNotArrivedStoreDeliveryOrder(List<Long> riderIds);

    void acceptSystemDispatchDeliveryOrder(Long deliveryOrderId);

    void grabbingOrder(Long deliveryOrderId);

    Integer reportToShop(Long deliveryOrderId);

    PageVO<WaitPickingDeliveryOrder> riderWaitPickingPage(PageDTO pageDTO);

    void confirmMealPickup(Long deliveryOrderId);

    void riderCompleteDelivery(Long deliveryOrderId) throws Exception;

    PageVO riderWaitDeliveryPage(PageDTO pageDTO);

    Set<ShopForMap> riderRoutePlanning(GeoCoordinates riderGeo);

    DeliveryOrderDetailsVO deliveryOrderDetail(Long deliveryOrderId, GeoCoordinates riderGeo) throws Exception;

    RiderDeliveryFeeForRiderOrderAccounting queryRiderDeliveryFeeForRiderOrderAccounting(Long orderId);

    CompletedQuantityStatisticsVO completedQuantityStatistics(LocalDateTime startTime, LocalDateTime endTime);


    DeliveryOrderForUserOrderMapVO deliveryInfoForUserOrderMap(Long orderId);

    void notifyRiderLocation(Long riderId, GeoCoordinates geo);
}
